package com.neusoft.web.a1;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.neusoft.services.impl.a1.CharacterServiceImpl;

/**
 * Servlet implementation class charaList
 */
@WebServlet("/charaList")
public class charaList extends HttpServlet {
	
	private CharacterServiceImpl services = new CharacterServiceImpl();
	private List<Map<String,String>> charaList = null;
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		try {
			charaList = services.findAllCharacters();
		}catch(Exception ex) {
			ex.printStackTrace();
		}
		//System.out.println(charaList);
		request.setAttribute("list", charaList);
		request.getRequestDispatcher("Character/Index_Character.jsp").forward(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}
	

}
